#pragma once
#include "bp/bp_platform.h"

//http://www.utf-8.com/
//https://www.czyborra.com/utf/
//https://www.utf8-chartable.de/unicode-utf8-table.pl
//https://tools.ietf.org/html/rfc3629

_BP_EXPORT const bp_char8_t * _BP_API bp_u8next(
	const bp_char8_t *u8, 
	size_t u8size, 
	bp_char32_t *charater);
_BP_EXPORT const bp_char8_t * _BP_API bp_u8next_codepoint(
	const bp_char8_t *u8, 
	size_t u8size, 
	bp_char32_t *codepoint);
_BP_EXPORT size_t _BP_API bp_u8encode(bp_char32_t codepoint, bp_bool input_is_little_endian, bp_char32_t *charater);

_BP_EXPORT const bp_char16_t * _BP_API bp_u16next(
	const bp_char16_t *u16, 
	size_t u16size, 
	bp_byte_order u16byteorder, 
	bp_char32_t *charater);
_BP_EXPORT const bp_char16_t * _BP_API bp_u16next_codepoint(
	const bp_char16_t *u16, 
	size_t u16size,
	bp_byte_order u16byteorder, 
	bp_char32_t *codepoint);

_BP_EXPORT size_t _BP_API bp_u16encode(bp_char32_t codepoint, bp_bool input_is_little_endian, bp_char32_t *charater);
//_BP_EXPORT size_t _BP_API bp_u16decode(const bp_char16_t *u16, size_t u16size, bp_char32_t *codepoint);

_BP_EXPORT size_t _BP_API bp_u8_to_u16(const bp_char8_t *u8, size_t u8size, bp_char16_t *u16, size_t u16size);
_BP_EXPORT size_t _BP_API bp_u16_to_u8(const bp_char16_t *u16, size_t u16size, bp_byte_order u16byteorder, bp_char8_t *u8, size_t u8size);